import Vue from 'vue';
import VueRouter from 'vue-router';
import layout from '../layout/index';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'Home',
    component: layout,
    redirect: '/base',
    children: [
      {
        path: '/base',
        name: 'base',
        component: () => import('@/views/base')
      },
      {
        path: '/3dTiles',
        name: '3dTiles',
        component: () => import('@/views/3dTiles')
      },
      {
        path: '/event',
        name: 'event',
        component: () => import('@/views/actions')
      },
      {
        path: '/primitive',
        name: 'primitive',
        component: () => import('@/views/primitive')
      },
      {
        path: '/points',
        name: 'points',
        component: () => import('@/views/points')
      },
      {
        path: '/check',
        name: 'check',
        component: () => import('@/views/check')
      },
      {
        path: '/splitPlane',
        name: 'splitPlane',
        component: () => import('@/views/splitPlane')
      }
    ]
  },

  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
];

const router = new VueRouter({
  routes
});

export default router;
